In some applications, the state of several switches needs to be monitored. Typically, in such applications, there are one or more separate input/output (I/O) lines for each switch that connect that switch to a microprocessor or controller. Each such I/O line is coupled to a respective I/O interface of the microprocessor. The microprocessor monitors the state of the switches by polling each of the switches to check the state of the switches.
When a large number of switches are monitored (for example, a number of switches that exceeds the number of microprocessor I/O interfaces available for use with such switches), an I/O expander or a programmable logic device (PLD) can be used to share the microprocessor I/O interfaces among the monitored switches. However, the microprocessor typically must implement a protocol for interacting with the I/O expander or PLD and for addressing the individual switches. Also, the amount of time required for the microprocessor to poll all of the switches through an I/O expander or PLD may be undesirable or unacceptable for some applications.
Also, the I/O interface that is used to monitor the state of the switch is typically not able to be used for other purposes. For example, where one state of each switch is used to determine when to read from or write to a memory device associated with that switch, another I/O interface or line would typically be needed for the microprocessor to read from or write to the memory device.